package com.gn.heavenpark.activity;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;

public class Rest extends TabActivity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.rest);
		Intent info = new Intent(this, RestInfo.class);
		Intent album = new Intent(this, RestAlbumList.class);
		Intent memo = new Intent(this, RestMemoList.class);

		
		/*
		TabHost tabs = getTabHost();

		tabs.addTab(tabs.newTabSpec("restInfo").setIndicator("프로필").setContent(info));
		tabs.addTab(tabs.newTabSpec("restAlbum").setIndicator("앨범").setContent(album));
		tabs.addTab(tabs.newTabSpec("restMemo").setIndicator("추모글").setContent(memo));
		
		tabs.setCurrentTab(0);
		*/
		
		
		TabHost tabHost=(TabHost)findViewById(android.R.id.tabhost);
		//TabHost tabHost=getTabHost();
		tabHost.setup();
		TabHost.TabSpec spec;
		
		LayoutInflater layout=getLayoutInflater();
		
		
		
		
		spec=tabHost.newTabSpec("profile");
		View vTab1 = layout.inflate(R.drawable.top_tab_profile, null);
		// TextView textsample = (TextView)vTab1.findViewById(Rid.textsample);
		// textsmaple.setText("샘플1")ㅣ
		spec.setIndicator(vTab1);
		spec.setContent(info);
		tabHost.addTab(spec);
		
		spec=tabHost.newTabSpec("album");                                  //탭메뉴 이름
		View vTab2 = layout.inflate(R.drawable.top_tab_album, null);           //셋팅된 레이아웃 생성
		spec.setIndicator(vTab2);											  //탭에 레이아웃 담음
		spec.setContent(album);                                            //탭에 컨텐츠 담음
		tabHost.addTab(spec);                                                 //탭 호스트에 탭메뉴를 얹는다
	
		spec=tabHost.newTabSpec("memo");
		View vTab3 = layout.inflate(R.drawable.top_tab_memo, null);
		spec.setIndicator(vTab3);
		spec.setContent(memo);
		tabHost.addTab(spec);
		
		tabHost.setCurrentTab(0);  //0번째 탭에을 처음으로 설정
		
	}
}
